<?php
/**
 * 素拓中心
 */
class QualityApp extends CommonApp {
    //素拓中心主页
    public function developmentAct(){
        //素拓活动
        $activities_s = My::item2list('datas','activities',array('pagesize'=>5,'publish'=>1,'order'=>'hot'));//5条
        $activities_b = My::item2list('datas','activities',array('pagesize'=>20,'publish'=>1,'order'=>'hot'));//20条
        $this->assign('activities_b',$activities_b);
        $this->assign('activities_s',$activities_s);

        //公告要闻
        $information = My::item2list('datas','information',array('pagesize'=>8,'publish'=>1,'order'=>'hot'));//8条
        $this->assign('information',$information);

        //素拓部门
        $section = My::item2list('datas','section',array('pagesize'=>8,'publish'=>1,'order'=>'hot'));//8条
        $this->assign('section',$section);

        //部门照片
        $photo = My::item2list('datas','section',array('pagesize'=>12,'publish'=>1,'order'=>'hot'));//12条
        $this->assign('photo',$photo);

        $this->display();

    }

    //素拓活动
    public function activitiesAct(){
        $result = self::getList('activities');
        self::assign_seo('activities');
        //最热
        $result['hit'] = My::item2list('datas','activities',array('pagesize'=>12,'publish'=>1,'order'=>'hot'));
        $this->assign('result',$result);
        $this->assign('type','activities');
        $this->assign('locat',array('locat' => '素拓活动','locat_en' => 'ACTIVITIES'));
        $this->display('Common/list2');
    }

    //公告要闻
    public function informationAct(){
        $result = self::getList('information');
        self::assign_seo('information');
        //最热
        $result['hit'] = My::item2list('datas','information',array('pagesize'=>12,'publish'=>1,'order'=>'hot'));
        $this->assign('result',$result);
        $this->assign('type','information');
        $this->assign('locat',array('locat' => '公告要闻','locat_en' => 'INFERMATION'));
        $this->display('Common/list2');
    }

    //素拓部门
    public function sectionAct(){
        $result = self::getList('section');
        self::assign_seo('section');
        //最热
        $result['hit'] = My::item2list('datas','section',array('pagesize'=>12,'publish'=>1,'order'=>'hot'));
        $this->assign('result',$result);
        $this->assign('type','section');
        $this->assign('locat',array('locat' => '素拓部门','locat_en' => 'SECTION'));
        $this->display('Common/list2');
    }
    
    //详情
    public function detailAct(){
        $id = I('get.id');
        if(!My::is_id($id))
            $this->ajaxReturn(404,'文章详情ID有误!');
        // $item = My::arr2var($_REQUEST,'item');
        $result = self::detail($id);
        $this->assign('result',$result);
        $this->assign('menu',self::menu($result['item']));
        $this->display('Common/detail');
    }
}